using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoreData;
using Services;
using Helper;
namespace ActionServices
{

    public interface IUsersActionService:BaseActionService
    {
        long Save(object _model);
        IList<CoreData.Users> GetListByLINQ(Func<CoreData.Users, Boolean> _where);
        CoreData.Users GetOneByLINQ(Func<CoreData.Users, Boolean> _where);
        bool Delete(object _model);
        IList<CoreData.Permission> GetUserModuleRole(string Username, string Password, ref string mess, ref long userid, ref long staffid, ref string staffname);
        IList<CoreData.Permission> GetGroupModuleRole(string Username, string Password, ref string mess, ref long userid, ref long staffid, ref string staffname);
        Users GetByGuidID(string GuidID);
    }

    public partial class UsersActionService:IUsersActionService
    {
       UsersService Service;

       public UsersActionService()
       {
           Service = new UsersService();
       }

       #region Main Method

       public virtual long Save(object _model)
       {
           return Service.Save(_model);
       }

       public virtual Users GetByGuidID(string GuidID)
       {
           return GetOneByLINQ(c => c.UserGuidID.Equals(GuidID));
        }

       public virtual object GetByID(long _id)
       {
           return Service.GetByID(_id);
       }

       public virtual object GetList()
       {
           return Service.GetList();
       }

       public virtual IList<CoreData.Users> GetListByLINQ(Func<CoreData.Users, Boolean> _where)
       {
           return Service.GetListByLINQ(_where);
       }

       public virtual CoreData.Users GetOneByLINQ(Func<CoreData.Users, Boolean> _where)
       {
           return Service.GetOneByLINQ(_where);
       }

       public virtual object GetList(string _searchstring)
       {
           return Service.GetList(_searchstring);
       }

       public virtual bool Delete(object _model)
       {
           return Service.Delete(_model);
       }

       #endregion


        #region Other Method
       public virtual IList<CoreData.Permission> GetGroupModuleRole(string Username, string Password, ref string mess, ref long userid, ref long staffid, ref string staffname)
       {
           return Service.GetGroupModuleRole(Username, Password, ref mess,ref userid, ref staffid, ref staffname);
       }
       public virtual IList<CoreData.Permission> GetUserModuleRole(string Username, string Password, ref string mess, ref long userid, ref long staffid, ref string staffname)
       {
           return Service.GetUserModuleRole(Username, Password,ref mess,ref userid, ref staffid, ref staffname);
       }
        #endregion

    }
         
}
